﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ContactList.aspx.cs" Inherits="AB.ServiceDirectory.Design.AContact.ContactList01"
    EnableEventValidation="false" %>

<%@ Register TagPrefix="cc1" Namespace="Vladsm.Web.UI.WebControls" Assembly="GroupRadioButton, Version=1.0.0.0, Culture=neutral, PublicKeyToken=93985c16c9bea92d" %>
<asp:Content ID="head" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="ContentTitle" ContentPlaceHolderID="ContentTitle" runat="server">
    <h2>CONTACT LIST</h2>
</asp:Content>
<asp:Content ID="Content" ContentPlaceHolderID="Content" runat="server">
    <asp:UpdatePanel ID="UpdatePanelContact" runat="server">
        <ContentTemplate>
            <div class="grid740 simplebox popup">
                <div class="titleh">
                    <h3>
                        Search Contact</h3>
                </div>
                <div class="body">
                    <div class="st-form-line">
                        <div class="half">
                            <asp:Label ID="FirstNameLabel" CssClass="st-labeltext" runat="server" Text="First Name"
                                AssociatedControlID="TextBoxFirstNameSearch"></asp:Label>
                            <asp:TextBox ID="TextBoxFirstNameSearch" CssClass="st-forminput" runat="server" Width="200px"></asp:TextBox>
                        </div>
                        <div class="half">
                            <asp:Label ID="LabelName" runat="server" CssClass="st-labeltext" Text="SurName"></asp:Label>
                            <asp:TextBox ID="TextBoxSurnameSearch" runat="server" CssClass="st-forminput" Width="200px"></asp:TextBox>
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="button-box">
                        <asp:Button ID="ButtonSearchContact" runat="server" Text="Search" CssClass="st-button"
                            CausesValidation="False" OnClick="ButtonSearchContact_Click" />
                        <asp:Button ID="ButtonNone" runat="server" Text="None" CssClass="st-button" CausesValidation="False"
                            OnClick="ButtonNone_Click" Visible="False" />
                        <asp:Button ID="ButtonClear" runat="server" Text="Clear" CssClass="st-button" CausesValidation="False"
                            OnClick="ButtonClear_Click" />
                        <asp:Button ID="ButtonCreate" runat="server" Text="Create" CssClass="st-button" CausesValidation="False"
                            OnClick="ButtonCreate_Click" />
                    </div>
                    <div class="st-form-line">
                        <div class="titleh">
                            <h3>
                                <asp:CheckBox ID="CheckBoxInactive" runat="server" Text="Include In-active contact ?"
                                    AutoPostBack="True" OnCheckedChanged="CheckBoxInactive_CheckedChanged" /></h3>
                        </div>
                        <asp:GridView ID="ContactGridView" CssClass="tablesorter" runat="server" AutoGenerateColumns="False"
                            DataKeyNames="ContactID" AllowPaging="true" PageSize="10" DataSourceID="ContactObjectDataSource"
                            AllowSorting="true">
                            <Columns>
                                <asp:TemplateField HeaderText="">
                                    <ItemTemplate>
                                        <cc1:GroupRadioButton ID="RadioChooseContact" runat="server" GroupName="groupContact" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Contact Name" SortExpression="ContactName">
                                    <ItemTemplate>
                                        <%# string.Format("{0} {1}", Eval("FirstName"), Eval("SurName")) %>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="header" />
                                </asp:TemplateField>
                                <asp:BoundField HeaderText="Mobile Phone" DataField="MobilePhone" SortExpression="MobilePhone">
                                    <HeaderStyle CssClass="header" />
                                </asp:BoundField>
                                <asp:BoundField HeaderText="Email" DataField="Email" SortExpression="Email">
                                    <HeaderStyle CssClass="header" />
                                </asp:BoundField>
                                <asp:TemplateField HeaderText="Contact Type" SortExpression="ContactTypeName">
                                    <ItemTemplate>
                                        <%# Eval("ContactType.ContactTypeName") %>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Is Active" SortExpression="IsActive">
                                    <ItemTemplate>
                                        <%# (bool)Eval("IsActive") ? "Yes" : "No" %>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <PagerStyle CssClass="pagination_table" />
                        </asp:GridView>
                        <asp:ObjectDataSource ID="ContactObjectDataSource" runat="server" SelectMethod="GetList"
                            TypeName="AB.ServiceDirectory.BO.AContactBO" EnablePaging="true" SelectCountMethod="GetListCount"
                            StartRowIndexParameterName="startRowIndex" MaximumRowsParameterName="maxRows"
                            SortParameterName="sortType" OnSelecting="ContactObjectDataSource_Selecting">
                            <SelectParameters>
                                <asp:Parameter Name="filter" Type="Object" ConvertEmptyStringToNull="False" />
                            </SelectParameters>
                        </asp:ObjectDataSource>
                        <br />
                        <div class="">
                            <asp:Button ID="ButtonSelect" runat="server" Text="Select" CssClass="st-button" CausesValidation="False"
                                OnClick="ButtonSelect_Click" Visible="False" />
                            <asp:Button ID="ButtonEdit" runat="server" Text="Edit" CssClass="st-button" CausesValidation="False"
                                OnClick="ButtonEdit_Click" />
                            <asp:Button ID="ButtonClose" runat="server" Text="Close" CssClass="st-button" CausesValidation="False"
                                OnClick="ButtonClose_Click" Visible="False" />
                        </div>
                    </div>
                </div>
            </div>
            <div class="clear">
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
